<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>应急调度详情</title>
    <link rel="stylesheet" href="/lib/layui/layui/css/layui.css">
    <script type="text/javascript" src="/lib/layui/layui.js"></script>
    <script type="text/javascript" src="/lib/jquery-2.1.4.min.js"></script>
    <%--<script type="text/javascript" src="/lib/layui/layui.all.js"></script>--%>
    <script type="text/javascript" src="/lib/layui/layui/layui.all.js"></script>
    <script type="text/javascript" src="/js/news/jquery-1.9.1.js"></script>

    <script type="text/javascript" src="/lib/layer/layer.js?20201106"></script>
    <script type="text/javascript" src="/lib/layui/layui/global.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <style>
        .layui-table td, .layui-table th{
            padding: 18px 15px;
        }
    </style>
</head>
<body>

<table class="layui-table" style="width: 90%;margin: 0px auto;margin-top: 6%;display: none">
    <colgroup>
        <col width="100">
        <col>
    </colgroup>
    <tbody>
    <tr>
        <td>事件名称:</td>
        <td> <div id="information"></div></td>
    </tr>
    <tr>
        <td>发生时间:</td>
        <td><div id="yzdata"></div></td>
    </tr>
    <tr>
        <td>发生地点:</td>
        <td><div id="place"></div></td>
    </tr>
    <tr>
        <td>应急反应领导小组:</td>
        <td><div id="rescueUser"></div></td>
    </tr>
    <tr>
        <td>应急反应执行小组:</td>
        <td><div id="rescueExecute"></div></td>
    </tr>
    <tr>
        <td>事件描述:</td>
        <td><div id="infoms"></div></td>
    </tr>
    </tbody>
</table>
    <script>
        //从地址栏获取参数
        function getQueryString(name){
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r!=null)return  unescape(r[2]); return null;
        }
        var crasId=getQueryString('crasId')
            $.ajax({
                url:'/crash/showDetails',
                type: 'get',
                dataType: 'json',
                data:{crasId:crasId},
                success:function (res) {
                    if(res.msg!=='err'){
                        $('.layui-table').show()
                        $("#information").html(res.obj.eventName);
                        $("#yzdata").html(res.obj.happenTime);
                        $("#place").html(res.obj.happenPlace)
                        $("#rescueUser").html(res.obj.rescueUserName);
                        $("#rescueExecute").html(res.obj.reactionUserName);
                        $("#infoms").html(res.obj.eventDescribe)
                    }else{
                        alert('该救援事件已被删除！')
                        $('.layui-table').hide()
                    }

                }
            });
    </script>
</body>